<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 具名函数
        function myFunction() {
            console.log('我是具名函数');
        }
        myFunction();
        // 匿名函数->鸿蒙不支持
        const fun = function () {
            console.log('我是匿名函数');
        }
        fun();
        // 箭头函数
        const arrow = () => {
            console.log('我是箭头函数');
        }
        arrow();

        //剩余参数:剩余参数必须是最后一个
        function sum(num1,num2,...args) {
        console.log(num1);
        console.log(num2);
        console.log(args);
        }
        sum(1,2,1232323,21321312)

    </script>
</body>
</html>